%option noyywrap
%{
#include "hoc.h"
#include "hoc.tab.h"
extern int lineno;
%}
%%
[ \t]	{ ; }				/* Skip blanks and tabs */

[0-9]+\.?|[0-9]*\.[0-9]+ {	/* Number */
	sscanf(yytext, "%lf", &yylval.val);
	return NUMBER; }

[_a-zA-Z][_a-zA-z0-9]* {	/* Variable */
	Symbol_t* ptr_sym;
	ptr_sym = lookup(yytext);
	if ( ptr_sym == NULL ) {
		ptr_sym = install(yytext, UNDEF, 0.0);
	}
	yylval.ptr_sym = ptr_sym;
	return ptr_sym->itype == UNDEF ? VAR : ptr_sym->itype;
	}

\n	{ lineno++; return '\n'; }	/* end of line */

.	{ return yytext[0]; }		/* everything else */
